package Eyjafjalla.power;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.helpers.FontHelper;
import com.megacrit.cardcrawl.powers.AbstractPower;

public abstract class AbstractEyjafjallaPower extends AbstractPower {
    public boolean enableExtraAmount = false;
    public boolean enableExtraString = false;
    public int extraAmount = -1;
    public String  extraString = "";

    private final Color greenColor = new Color(0.0F, 1.0F, 0.0F, 1.0F);
    private static final float DISTANCE = 17F * Settings.scale;

    @Override
    public void renderAmount(SpriteBatch sb, float x, float y, Color c) {
        super.renderAmount(sb, x, y, c);
        if(!enableExtraAmount&&!enableExtraString)
            return;

        if (!this.isTurnBased) {
            this.greenColor.a = c.a;
            c = this.greenColor;
        }
        if(enableExtraAmount)
            FontHelper.renderFontRightTopAligned(sb, FontHelper.powerAmountFont, Integer.toString(this.extraAmount), x, y+DISTANCE, this.fontScale, c);
        else
            FontHelper.renderFontRightTopAligned(sb, FontHelper.powerAmountFont, extraString, x, y+DISTANCE, this.fontScale, c);
    }
}
